﻿<html>
	<body background="pic/background_06.gif">
	<head>
		<font face="新細明體,time new roman,Arial">
		<meta charset="UTF-8">
	</head>
	<body>
		<center>
			<font size="5" color="#0000FF"><b>--- 站別,查詢結果 ---</b></font><br>
			<hr>
			<?php
				header("content-type:text/html;charset=utf-8");
				// Loading all php class variable and fucntions ...
				require_once('class_package/common.php');
				
				// 各下载程式, 输入资料判断 ...
				$get_prgm_select = trim($_POST['partnum']);
				$append_InputFailStr[] = '';
				$webdl_work_order = "";
				$ict_show_all = 0;
				$get_prgm_select=strtoupper($get_prgm_select);
				if($get_prgm_select=='ALL'||empty( $get_prgm_select )) {
					//查詢所有的站別
					$result=setting_select();
					if(!$result){						
						echo "<script>alert('MySql資料庫搜尋失敗, 請跟開發人員查明原因...');history.go(-1);</script>";
						exit();
					}
					
					$rows = mysqli_num_rows($result);		// 返回结果集中栏位的数量。	
			
					if ( $rows == 0 ) { 
						$prg_rows_fail = 1;
						echo "<script>alert('MySql資料庫搜尋失敗, 請跟開發人員查明原因...');history.go(-1);</script>";
					} else{
						echo '<br>
							<font size="4" color="#000000"><b>所有站別</b></font>
							<table border="2" width="75%">
								<tr bgcolor="#70DB93">
									<th>No.</th>
									<th>站別</th>
									<th>創建人</th>
									<th>創建時間</th>
									<th>更新人</th>
									<th>更新時間</th>
									<th>操作</th>		
									
								</tr>';
							$mun=0;		
						while ( $getArray = mysqli_fetch_array($result,MYSQLI_ASSOC) ) {
							// To loading all datas from MySQL ...
							$mun++;
							$put_id          = $getArray['id'];
							$put_wsid        = trim($getArray['web_wsid']);
							$put_create_by       = trim($getArray['create_by']);
							$put_create_time  = $getArray['create_time'];
							$put_update_by        = $getArray['update_by'];
							$put_update_time       = $getArray['update_time'];
							$url ="webdl_wsid_delete.php?wsid=$put_wsid &createUser=$put_create_by";
							$url=trim($url);
							echo "
							<tr>
								<th>$mun</th>
								<th><b>$put_wsid</b></font></th>
								<th>$put_create_by</th>
								<th>$put_create_time</th>
								<th>$put_update_by</th>
								<th>$put_update_time</th>	
								<th><a href='javascript:void(0);' ".'onclick="'."firm('$url')".'">刪除</a></th>
							</tr>';
						}
					}
					
				} else {
					//查询单个站位信息
					$result=setting_select($get_prgm_select);
					if(!$result){						
						echo "<script>alert('MySql資料庫搜尋失敗, 請跟開發人員查明原因...');history.go(-1);</script>";
						exit();
					}
					
					$rows = mysqli_num_rows($result);		// 返回结果集中栏位的数量。	
			
					if ( $rows == 0 ) { 
						$prg_rows_fail = 1;
						echo "<script>alert('站位資料不存在...');history.go(-1);</script>";
					} else{
						echo '<br>
							<font size="4" color="#000000"><b>所有站別</b></font>
							<table border="2" width="75%">
								<tr bgcolor="#70DB93">
									<th>No.</th>
									<th>站別</th>
									<th>創建人</th>
									<th>創建時間</th>
									<th>更新人</th>
									<th>更新時間</th>
									<th>操作</th>		
									
								</tr>';
							$mun=0;		
						while ( $getArray = mysqli_fetch_array($result,MYSQLI_ASSOC) ) {
							// To loading all datas from MySQL ...
							$mun++;
							$put_id          = $getArray['id'];
							$put_wsid        = trim($getArray['web_wsid']);
							$put_create_by       = trim($getArray['create_by']);
							$put_create_time  = $getArray['create_time'];
							$put_update_by        = $getArray['update_by'];
							$put_update_time       = $getArray['update_time'];
							$url ="webdl_wsid_delete.php?wsid=$put_wsid &createUser=$put_create_by";
							$url=trim($url);
							echo "
							<tr>
								<th>$mun</th>
								<th><b>$put_wsid</b></font></th>
								<th>$put_create_by</th>
								<th>$put_create_time</th>
								<th>$put_update_by</th>
								<th>$put_update_time</th>	
								<th><a href='javascript:void(0);' ".'onclick="'."firm('$url')".'">刪除</a></th>
							</tr>';
						}
					}
					
				}
				
				echo '<script type="text/JavaScript">
					//弹出一个询问框，有确定和取消按钮  
					function firm(par) {  
						//利用对话框返回的值 （true 或者 false）  
						if (confirm("你确定删除吗？")) {  
							//var url = "10.10.15.86:88/"+par;
							//alert("queding"+url);
							window.location.href=par;
						}  					
					}  
				</script>
				';
				exit();
				
				
			?>
		</center>
	</body>
</html>










